package cn.com.dbappsecurity.utils;

import org.apache.commons.lang.StringUtils;

public class ObjectUtil {

	private ObjectUtil(){
	}
	
	/**
	 * 获取字符串，如为空则返回默认值
	 * @param obj
	 * @param def
	 * @return
	 */
	public static String getString(Object obj,String def){
		if(obj != null){
			String str = obj.toString();
			if(!StringUtils.isBlank(str)){
				return str;
			}
		}
		return def;
	}
}
